package com.smarttiger.zero.admin.service;

import com.smarttiger.zero.admin.dao.SubscribeDao;
import com.smarttiger.zero.admin.entity.SubscribeModel;
import com.smarttiger.zero.admin.util.ParamNames;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
public class SubscribeService extends BaseService<SubscribeModel> {
    @Autowired
    SubscribeDao dao;

    @PostConstruct
    public void initMethod() {
        super.setDao(dao);
    }

    @ParamNames("messageId")
    public List<SubscribeModel> getDataByMesaageId(String mId){
        return dao.findAllByMessageIdOrderByCreateDate(mId);
    }
}
